﻿<Window x:Class="FrontEnd.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fe="clr-namespace:FrontEnd"
        Title="Database Manager" Height="768" Width="1024" DataContext="{Binding RelativeSource={RelativeSource Self}}">

	<Window.CommandBindings>
		<CommandBinding Command="New" Executed="Create" />
		<CommandBinding Command="fe:MyCommands.Exit" Executed="Exit" />
		<CommandBinding Command="fe:MyCommands.NewTab" CanExecute="CanCreateNewTab" Executed="NewTab" />
	</Window.CommandBindings>
	
	<Grid>		
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>

        <Menu IsMainMenu="True">
			<MenuItem Header="_File">
				<MenuItem Header="New Database..." Command="New" />
				<Separator />
				<MenuItem Header="Exit" Command="fe:MyCommands.Exit" />
			</MenuItem>
			<MenuItem Header="_Query">
                <MenuItem Header="Execute" Command="fe:MyCommands.Execute" />
            </MenuItem>
			<MenuItem Header="_Help" />
		</Menu>

		<ToolBarPanel Grid.Row="1" Orientation="Horizontal">
			<ToolBarTray>
				<ToolBar>
					<Button Content="Import" Command="fe:MyCommands.Import" />
				</ToolBar>
				<ToolBar>
					<Button Content="Execute" Command="fe:MyCommands.Execute" />
				</ToolBar>
			</ToolBarTray>
		</ToolBarPanel>

        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="250" />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

			<fe:ObjectExplorer x:Name="objExplorer" />

			<GridSplitter Grid.Column="1" Width="4" HorizontalAlignment="Stretch"/>
			<TabControl Name="tabQueryWindows" Grid.Column="2" />
		</Grid>

		<StatusBar Grid.Row="3">
			<StatusBarItem>
				<TextBlock Text="..." />
			</StatusBarItem>
		</StatusBar>
    </Grid>
</Window>
